package com.hero.jobweb.action.template;

import com.hero.web.action.BasePaginationAction;
import com.hero.web.entity.BaseEntity;
import com.hero.web.entity.Pagination;


/**
 * 分页执行模板
 * @author Volcano
 *
 */
public abstract class PaginationActionExecuteTemplate implements
		ActionExecuteTemplate {

	private BasePaginationAction basePaginationAction;
	public BasePaginationAction getBasePaginationAction() {
		return basePaginationAction;
	}
	public void setBasePaginationAction(BasePaginationAction basePaginationAction) {
		this.basePaginationAction = basePaginationAction;
	}
	public BaseEntity getBaseEntity() {
		return baseEntity;
	}
	public void setBaseEntity(BaseEntity baseEntity) {
		this.baseEntity = baseEntity;
	}
	private BaseEntity baseEntity;
	public PaginationActionExecuteTemplate(BasePaginationAction basePaginationAction,BaseEntity baseEntity)
	{
		this.basePaginationAction=basePaginationAction;
		this.baseEntity=baseEntity;
	}
	public void execute() {
		basePaginationAction.setPagination(new Pagination(basePaginationAction.getPageIndex()));
		baseEntity.setPagination(basePaginationAction.getPagination());
		doImpl();
		basePaginationAction.setPageIndex(basePaginationAction.getPagination().getPageIndex());
	}
}
